<?php

define('IN_SCRIPT',1);
define('HESK_PATH','../');

/* Get all the required files and functions */
require(HESK_PATH . 'hesk_settings.inc.php');
require(HESK_PATH . 'inc/common.inc.php');
require(HESK_PATH . 'inc/database.inc.php');

hesk_dbConnect();

if (!empty($_GET['id_prov'])) {
    $id_province = $_GET['id_prov'];
    $query = 'SELECT * FROM hesk_kota WHERE id_propinsi='.$id_province;
    $result = hesk_dbQuery($query);
    while ($kota = hesk_dbFetchAssoc($result)) {
        $city->$kota['id_kota'] = $kota['kota']; 
    }
    $json = json_encode($city);
    echo $json;
}
?>
